package com.hhkj.api.train.model.info.res;

import cn.hutool.core.bean.BeanUtil;
import com.hhkj.admin.question.model.res.QuestionRes;
import com.hhkj.api.train.common.utils.ApiQuestionCollectionConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * TrainTestRes
 *
 * @author ZhengJun
 * @since 2023/5/26 21:05
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
public class ApiTrainTestRes extends ApiTrainRes
{

    /** 题目列表 */
    private List<ApiQuestionTestRes> questionList;

    public ApiTrainTestRes(String trainKey, Integer effectiveMinute, List<QuestionRes> questionGroupList)
    {
        super(trainKey, effectiveMinute);
        List<ApiQuestionRes> apiQuestionResList = ApiQuestionCollectionConverter.convertList(questionGroupList);
        this.questionList = BeanUtil.copyToList(apiQuestionResList, ApiQuestionTestRes.class);
    }
}
